home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9206.ARJ
/
1006098A
< prev
next >
Wrap
Text File
|
1992-06-02
|
405b
|
23 lines
#include <stdio.h>
#define MAX_LEN 10
main()
{
char str[MAX_LEN + 1];
char edit_mask[6];
printf("Enter string (max length %u): ", MAX_LEN);
sprintf(edit_mask, "%%%us", MAX_LEN);
scanf(edit_mask, str);
printf("edit_mask contains >%s<, str contains >%s<\n",
edit_mask, str);
return (0);
}
Enter string (max length 10): abc
edit_mask contains >%10s<, str contains >abc<